package com.heima.user.feign;

import com.heima.apis.user.IUserClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AuthDto;
import com.heima.user.service.UserAuditService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserClient implements IUserClient {
    @Autowired
    private UserAuditService userAuditService;

    /**
     * 获取审核列表
     */
    @PostMapping("/api/v1/auth/list")
    public ResponseResult list(@RequestBody AuthDto dto){
        return userAuditService.userlist(dto);
    }

    /**
     * 审核失败
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/auth/authFail")
    @Override
    public ResponseResult authFail(@RequestBody AuthDto dto) {
        return userAuditService.authFail(dto);
    }

    /**
     * 审核通过
     *
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/auth/authPass")
    @Override
    public ResponseResult authPass(@RequestBody AuthDto dto) {
        return userAuditService.authPass(dto);
    }
}
